
package com.example.xlzx.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.xlzx.dao.CaseAnalysisMapper;
import com.example.xlzx.entity.CaseAnalysis;
import com.example.xlzx.service.ICaseAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * <p>
 * 案例分析表 服务实现类
 * </p>
 *
 * @author 1
 * @since 2025-03-07
 */
@Service
public class CaseAnalysisServiceImpl extends ServiceImpl<CaseAnalysisMapper, CaseAnalysis> implements ICaseAnalysisService {
    @Autowired
    private CaseAnalysisMapper caseAnalysisMapper;
    @Override
    public IPage<CaseAnalysis> pageCaseAnalysis(Page<CaseAnalysis> pageParam, String keyword) {
        Page<CaseAnalysis> page = this.lambdaQuery()
                .like(keyword!=null,CaseAnalysis::getTitle, keyword)
                .page(pageParam);
        return page;
    }

    @Override
    public boolean insertCaseAnalysis(CaseAnalysis caseAnalysis) {
        return save(caseAnalysis);
    }

    @Override
    public boolean deleteCaseAnalysisById(Long id) {
        return removeById(id);
    }

    @Override
    public boolean updateCaseAnalysis(CaseAnalysis caseAnalysis) {
        return updateById(caseAnalysis);
    }

    @Override
    public CaseAnalysis getCaseAnalysisById(Long id) {
        return getById(id);
    }
}
